import { useSelector, useDispatch } from "react-redux"
import numStatus from "@/store/Numstatus/index"
const View = () => {
  const { num,arr } = useSelector((state: any) => ({
    num: state.handlenum.num,
    arr: state.handlearr.arr
  }))
  const Dispatch = useDispatch()
  const changenum = () => {
    Dispatch({ type: 'add2', val: 10 })
  }
  const changenum2 = () => {
    Dispatch<any>(numStatus.asyncActions.asyncAdd1)
  }
  const changearr = () => {
    Dispatch({ type: 'arrpush', val: 100 })
  }
  return (
    <div>page1
      <p>{num}</p>
      <button onClick={changenum}>11111</button>
      <button onClick={changenum2}>22222</button>
      <p>{arr}</p>
      <button onClick={changearr}>11111</button>
    </div>
  )
}

export default View